import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        // 二进制中1的个数
        int n = 5;
        int count = 0;
        while (n!=0){
            count++;
            n=n&(n-1);
        }
        System.out.println(count);

    }
    public static void main51(String[] args) {
        // 水仙花数 152=1^3+5^3+3^3
        for (int i = 0; i<1000 ; i++){
            int count = 0;
            int temp = i;
            while (temp !=0){
                count++;
                temp = temp/10;
            }
            temp = i;
            int sum = 0;
            while(temp !=0){
                sum+=   Math.pow(temp%10,count);
                temp /=10;
            }
            if(sum == i){
                System.out.println(i);

            }
        }

    }

    public static void main41(String[] args) {
        //猜数字游戏
        Random random = new Random();//  随机数  每次根据当前时间变化
        int randnum = random.nextInt(11);//[0~11)
        Scanner scanner = new Scanner(System.in);
        while (true){
            System.out.println("输入数字");
            int num = scanner.nextInt();
            if(num >randnum){
                System.out.println("猜大了");
            }else if (num == randnum){
                System.out.println("对了");
                break;
            }else {
                System.out.println("小了");
            }
        }
    }
    public static void main3211(String[] args) {
        //9*9表
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i=1;
        int j=1;
        for(i=1;i<=n;i++) {
            for(j=1;j<=i;j++) {
                System.out.print(j+"*"+i+"="+j*i+" " );
            }
            System.out.println();
        }

    }
    public static void main321(String[] args) {
        Scanner scanner =new Scanner(System.in);
        int key = 123456;
        int t=1;
        while(t<=3){
            System.out.println("账号:"+"123445678345");
            System.out.println("密码：");
            int key1 =scanner.nextInt();
            if(key!=key1){
                System.out.println("输入错误");

            }else{
                System.out.println("登陆成功");
                break;
            }
            t++;
        }
    }
    public static void main212(String[] args) {
        double sum = 1;
        double t = 2;
        while (t <= 100){
            if( t%2!=0){
                sum=sum+(1/t);
            }else{
                sum=sum-(1/t);
            }
            t++;
        }
        System.out.println(sum);
    }
    public static void main111(String[] args) {
            Scanner scanner =new Scanner(System.in);
            System.out.print("输入：");
            int a =scanner.nextInt();
            int b =scanner.nextInt();
            int c =0;
            while (c != a%b)//辗转相除法
            {
                a = b;
                b = c;
            }
            System.out.println("输出："+b);
    }
    public static void main12(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t =2;
        int i = scanner.nextInt() ;
        while(t<i){
            if(i%t==0) {
                System.out.println("不是素数");
                break;
            }
            t++;
        }
        System.out.println("是素数");
    }
    public static void main1(String[] args) {
        int num = 0;
        int t = 1;
        while(t<=100){
                if(t%10==9){
                    num++;
                }
                if(t/10==9){
                    num++;
                }
                t++;
        }
        System.out.println(num);
    }
}
